package cn.micro.system.manage.entity;
import cn.micro.system.manage.common.vaildate.ValidateGroup;
import cn.micro.system.manage.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author wr
 * @since 2023-12-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysDimMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;



    /**
     * 所属上级ID(父菜单ID)
     */
    @NotNull(message = "所属上级ID不能为空",groups = ValidateGroup.add.class)
    private Long parentId;

    /**
     * 名称
     */
    @NotEmpty(message = "名称不能为空",groups = ValidateGroup.add.class)
    private String name;

    /**
     * 类型(0:目录,1:菜单,2:按钮)
     */
    @NotNull(message = "类型不能为空",groups = ValidateGroup.add.class)
    private Integer type;

    /**
     * 路由地址
     */
    private String path;

    /**
     * 组件路径
     */
    private String component;

    /**
     * 权限标识
     */
    private String perms;

    /**
     * 图标
     */
    private String icon;

    /**
     * 排序
     */
    private Integer sortValue;

    /**
     * 状态(0:禁止,1:正常)
     */
    private Integer status;



    // 下级列表
    @TableField(exist = false)
    private List<SysDimMenu> children;

    //是否选中
    @TableField(exist = false)
    private boolean isSelect;

    public static final String ID = "id";

    public static final String PARENT_ID = "parent_id";

    public static final String NAME = "name";

    public static final String TYPE = "type";

    public static final String PATH = "path";

    public static final String COMPONENT = "component";

    public static final String PERMS = "perms";

    public static final String ICON = "icon";

    public static final String SORT_VALUE = "sort_value";

    public static final String STATUS = "status";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String IS_DELETED = "is_deleted";

}
